package me.jiatao.jetpack.room;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.PrimaryKey;

/**
 * Created by JiaTao on 2018/10/10.
 * Email: 535318720@qq.com
 * Version: 1.0
 * Description:
 */
@Entity(foreignKeys = @ForeignKey(
        entity = User.class,
        parentColumns = "uid",
        childColumns = "user_id",
        //级联删除
        onDelete = ForeignKey.CASCADE))
public class Book {
    @PrimaryKey(autoGenerate = true)
    public int bookId;
    public String title;
    @ColumnInfo(name = "user_id")
    public int userId;
}